4 echo "Usage: $0 <sketch name> [upload]"
8 # assign WIFI_SSID and WIFI_PASS in external file ../info
13 TMP="/tmp/ESPcompile.tmp"
15 MAKE_FILE="~/Bin/SDK/ESP/makeEspArduino/makeEspArduino.mk"
16 ESP_SDK_ROOT=~/Bin/SDK/arduino-1.8.5/hardware/esp8266com/esp8266 # keep it without quotation marks
18 # nodemcuv2, generic, esp8285
20 # BUILD_EXTRA_FLAGS="-DIM_WIFI_SSID=\"$WIFI_SSID\" -DIM_WIFI_PASS=\"$WIFI_PASS\""
21 # make clean -f "$MAKE_FILE" ESP_ROOT=$ESP_SDK_ROOT F_CPU=80000000L CHIP=esp8266 BOARD=esp8285 SKETCH="$SKETCH" $2
22 stdbuf -oL make -f "$MAKE_FILE" ESP_ROOT=$ESP_SDK_ROOT F_CPU=80000000L CHIP=esp8266 BOARD=esp8285 SKETCH="$SKETCH" $2 2>&1 | tee "$TMP"
24 if [ -s "$TMP" ]; then
25 binSRC=$( cat "$TMP" | grep Linking | sed -e 's/Linking //g' )
28 serialPort=$(cat "$TMP" | grep "opening port" | awk '{split($0,a," "); print a[3]}')
30 serialPort=/dev/ttyUSB0
42 if cat "$TMP" | grep -q 'error'; then
45 if [ "$1" != "noserial" ]; then
47 echo "Connecting $serialPort"
54 echo "Serial terminal omited"